﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace EssenceFeed.Data.EntityModel
{
    /// <summary>
    /// Subscription
    /// </summary>
    [MetadataType(typeof (CustomerMetaData))]
    public partial class Customer
    {
        #region Nested type: CustomerMetaData

        /// <summary>
        /// Subscription Meta Data
        /// </summary>
        [Bind(Exclude = "CustomerId")]
        public class CustomerMetaData
        {
            /// <summary>
            /// SubscriberId
            /// </summary>
            [ScaffoldColumn(false)]
            public object CustomerId { get; set; }

            /// <summary>
            /// UserId
            /// </summary>
            [ScaffoldColumn(false)]
            public object UserId { get; set; }

            /// <summary>
            /// First Name
            /// </summary>
            [Required(ErrorMessage = "First Name is required")]
            [StringLength(160)]
            public string FirstName { get; set; }

            /// <summary>
            /// Last Name
            /// </summary>
            [Required(ErrorMessage = "Last Name is required")]
            [StringLength(160)]
            public string LastName { get; set; }

            /// <summary>
            /// Birth Date
            /// </summary>
            [Required(ErrorMessage = "Birth Day is required")]
            public DateTime BirthDate { get; set; }

            /// <summary>
            /// Phone
            /// </summary>
            [Required(ErrorMessage = "Phone is required")]
            [StringLength(160)]
            public string Telephone { get; set; }

            /// <summary>
            /// Fax
            /// </summary>
            public string Fax { get; set; }

            /// <summary>
            /// Email Address
            /// </summary>
            [Required(ErrorMessage = "Email Required!")]
            [RegularExpression(
                "^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\\-+)|([A-Za-z0-9]+\\.+)|([A-Za-z0-9]+\\++))*[A-Za-z0-9]+@((\\w+\\-+)|(\\w+\\.))*\\w{1,63}\\.[a-zA-Z]{2,6}$"
                , ErrorMessage = "Not a valid email!")]
            public string Email { get; set; }

            /// <summary>
            /// Address1
            /// </summary>
            [Required(ErrorMessage = "Address is required")]
            [StringLength(160)]
            public string Address { get; set; }

            /// <summary>
            /// Town/City
            /// </summary>
            [Required(ErrorMessage = "City is required")]
            [StringLength(160)]
            public string City { get; set; }

            /// <summary>
            /// State
            /// </summary>
            [Required(ErrorMessage = "State is required")]
            [StringLength(160)]
            public string State { get; set; }

            /// <summary>
            /// Country
            /// </summary>
            [Required(ErrorMessage = "Country is required")]
            [StringLength(160)]
            public string Country { get; set; }

            /// <summary>
            /// Postal Code
            /// </summary>
            [Required(ErrorMessage = "Postal Code is required")]
            [StringLength(160)]
            public string PostalCode { get; set; }
        }

        #endregion
    }
}